<!DOCTYPE html>
<html>
${r'<#assign title="${table.remarks}">'}
${r'<#include "/util/head.ftl">'}
<body>
<div class="layui-fluid">
	<div class="layui-row">
	<fieldset class="layui-elem-field layui-field-title">
  		<legend>${table.remarks}</legend>
	</fieldset>
	${r'<#assign page=param.page/>'}
 	${r'<#assign list=param.page.list/>'}
	<form id="submitForm" action="/${table.module?uncap_first}/${table.javaName?uncap_first}/list.htm" autocomplete="on" method="get">
		<div class="layui-inline">
			<#list table.columns as column>
			<#if column.searchFlag==1>
			<label>${column.remarks}</label>
			<#if column.javaType=='Date'>
			<div class="layui-input-inline">
				<input type="text" id="${column.javaName}Begin" name="exParam['${column.javaName}Begin']" value="${r'${'}param.exParam.${column.javaName}Begin!${r'}'}" autocomplete="off" class="layui-input">
			</div>
			-
			<div class="layui-input-inline">
				<input type="text" id="${column.javaName}End" name="exParam['${column.javaName}End']" value="${r'${'}param.exParam.${column.javaName}End!${r'}'}" autocomplete="off" class="layui-input">
			</div>
			<#elseif column.javaType=='String'>
			<div class="layui-input-inline">
				<input type="text" name="${column.javaName}" value="${r'${'}param.${column.javaName}!${r'}'}" autocomplete="off" class="layui-input">
			</div>
			<#else>
			<div class="layui-input-inline">
				<input type="text" name="${column.javaName}" value="${r'${'}param.${column.javaName}!${r'}'}" autocomplete="off" class="layui-input">
			</div>
			</#if>
			</#if>
			</#list>
		</div>
		<div style="padding-top: 10px">
			<div class="layui-btn-group">
				<button class="layui-btn layui-btn-sm layui-btn-primary" type="button" onclick="addData(formUrl)">
					<i class="layui-icon">&#xe608;</i>新增
				</button>
				<button class="layui-btn layui-btn-sm layui-btn-danger" type="button" onclick="deleteData(deleteUrl)">
					<i class="layui-icon">&#xe640;</i>删除
				</button>
			</div>
			<div style="float: right;">
				<button class="layui-btn layui-btn-radius layui-btn-sm" lay-submit lay-filter="submitForm">
					<i class="layui-icon">&#xe615;</i>查询
				</button>
				<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius" onclick="location.reload();">
					<i class="layui-icon">&#xe63d;</i>刷新
				</button>
				<button type="button" class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius" onclick="formReset()">
					<i class="layui-icon">&#x1002;</i>重置
				</button>
			</div>
		</div>
	</form>
	<table class="layui-table" id="main-table" lay-filter="main-table" lay-even>
		<thead>
			<tr>
				<th lay-data="{field:'id',checkbox:true}"></th>
				<#list table.columns as column>
				<#if column.name!='id'  && column.name!='delflag'>
	 			<th lay-data="{field:'${column.javaName}'}">${column.remarks}</th>
				</#if>
				</#list>
				<th lay-data="{field:'handleZone'}">操作</th>
			</tr>
		</thead>
		<tbody>
			${r'<#list list as '}${table.javaName?uncap_first}>
			<tr>
				<td>${r'${'}${table.javaName?uncap_first}.id${r'}'}</td>
 			<#list table.columns as column>
				<#if column.name!='id'  && column.name!='delflag'>
				<#if column.javaType=='Date'>
				<td>${r'${'}${table.javaName?uncap_first}.${column.javaName}?string('yyyy-MM-dd HH:mm:ss')${r'}'}</td>
				<#else>
	 			<td>${r'${'}${table.javaName?uncap_first}.${column.javaName}!''${r'}'}</td>
				</#if>
				</#if>
			</#list>
				<td>
					<div class="layui-btn-group">
						<button class="layui-btn layui-btn-xs layui-btn-primary" onclick="viewData(formUrl,'${r'${'}${table.javaName?uncap_first}.id${r'}'}')">查看</button>
						<button class="layui-btn layui-btn-xs layui-btn-normal" onclick="editData(formUrl,'${r'${'}${table.javaName?uncap_first}.id${r'}'}')">编辑</button>
						<button class="layui-btn layui-btn-xs layui-btn-danger" onclick="deleteData(deleteUrl,'${r'${'}${table.javaName?uncap_first}.id${r'}'}')">删除</button>
					</div>
				</td>
			</tr>
			${r'</#list>'}
		</tbody>
	</table>
	${r'<#include "/util/page.ftl">'}
	</div>
</div>
<script type="text/javascript">

	var formUrl = "/${table.module?uncap_first}/${table.javaName?uncap_first}/form.htm";
	var deleteUrl = "/${table.module?uncap_first}/${table.javaName?uncap_first}/delete.json";

	<#list table.columns as column>
	<#if column.javaType=='Date'>
	layui.laydate.render({
		  elem: '#${column.javaName}Begin'
	});
	layui.laydate.render({
		  elem: '#${column.javaName}End'
	});
	</#if>
	</#list>
</script>
</body>
</html>